package sw6.NotificationMonkey;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageButton;
import android.widget.ImageView;

public class NotificationActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.notification);
        
        ImageView v = (ImageView)findViewById(R.id.notificationImage);
        v.setImageResource(R.drawable.notification_monkey);
        
        ImageButton acceptButton = (ImageButton)findViewById(R.id.acceptButton);
        
        acceptButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        
        ImageButton dismissButton = (ImageButton)findViewById(R.id.dismissButton);
        
        dismissButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(NotificationActivity.this, NotificationService.class);
                stopService(i);
                
                finish();
            }
        });
    }
}
